<template>
  <div>
    <div class="pay-done-box">
      <img src="static/img/pay-success.png" />
      <Button type="primary">拷贝如下下载链接即可</Button>
      {{pptUrl}}
    </div>
  </div>
</template>

<script>
export default {
  name: 'PayDone',
  data() {
    return {
      pptUrl: ''
    };
  },
  created() {
    this.downloadPPT();
  },
  methods: {
    downloadPPT() {
      // 根据当前路径的gid 发请求，获取链接
      // 然后函数式跳转
      this.$axios({
        method: 'get',
        url: `/product/goods/info/${this.$route.query.gid}`
      })
        .then(({ data }) => {
          // console.log('downloadPPT', data);
          // this.$router.push(data.goods.demoAddr);
          this.pptUrl = '' + data.goods.demoAddr;
          console.log('downloadPPT', this.pptUrl);
        })
        .catch(error => console.log(error));
    }
  }
};
</script>

<style scoped>
.pay-done-box {
  height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
</style>
